-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for source links on GitHub enterprise instances #843
Add support for source links on GitHub enterprise instances #843
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I'd like to find some way to unit test this.
I had a look at writing some tests, and can get one that would test that it defaults to import * as github from './../lib/converter/plugins/GitHubPlugin';
import Assert = require('assert');
describe('GitHubRepository', function() {
let repository = new github.Repository('', '');
describe('contructor', function() {
it('must default to github.com hostname', function() {
Assert.equal(repository.gitHubHostname, 'github.com');
});
});
}); Any ideas @aciccarello ? |
Needed for better unit testing
Allows us to more easily unit test the class by passing in an array of strings
I figured it out, with a small refactor. Should be good to go @aciccarello! |
@aciccarello Any thoughts on this? Thanks! |
Sorry for not following up on this @tomratcliffe. I'm hoping to look at it this week. |
Thanks for your contribution @tomratcliffe! |
This adds support for GitHub Enterprise source URLs found in the list of
git ls-remote --get-url
.The updated regex checks for URLs like
github.acme.com
instead of justgithub.aaakk.us.kg
, and then uses the matched hostname when generating the source URLs.I didn't add any tests for this as I'm not sure what your testing strategy is/I couldn't find a testing file for just this module. Happy to try and add this in though if required!
Should be backwards compatible with old URLs.
Fixes #249, which was closed in favour of #129.
This doesn't entirely solve #129, but closes the gap on allowing GHE to work out of the box.